package fenetre;

import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import org.apache.log4j.Logger;

@SuppressWarnings("serial")
public class Fenetre extends JFrame implements ActionListener {
	
	private Logger mLogger = Logger.getLogger(Main.class.getName());
	
	private Panneau mPanneau;
	
	private JMenuBar mMenuBar = new JMenuBar();
	private JMenu mMenuFichier = new JMenu("Fichier");
	private JMenuItem mMenuItemCharger = new JMenuItem("Charger");
	
	
	
	public Fenetre() throws HeadlessException {
		mLogger.debug("Initialisation de la Fenetre");
		setTitle("Gestionnaire d'interface");
		setSize(1300, 700);
		mPanneau = new Panneau();
		add(mPanneau);
		mMenuItemCharger.addActionListener(this);
		mMenuFichier.add(mMenuItemCharger);
		mMenuBar.add(mMenuFichier);
		
		setJMenuBar(mMenuBar);
		setVisible(true);
	}



	@Override
	public void actionPerformed(ActionEvent aArg0) {
		Object lSource = aArg0.getSource();
		if(lSource == mMenuItemCharger){
			mPanneau.charger();
		}
	}

	
}
